﻿<ribbon:RibbonWindow x:Class="WordsViaSubtitle.MainRibbonWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        xmlns:ex="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"
        Title="Words Via Subtitle" 
        x:Name="Window"
        Width="1000" Height="600">
    <ex:BusyIndicator IsBusy="False" Name="busyIndicator">
        <Grid x:Name="LayoutRoot">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <ribbon:Ribbon x:Name="Ribbon">
                <ribbon:Ribbon.Items>
                    <ribbon:RibbonTab x:Name="HomeTab" 
                              Header="Home">

                        <ribbon:RibbonGroup x:Name="openSubtitleGroup" Header="Open Subtitle">
                            <ribbon:RibbonButton Label="Open" LargeImageSource="Images/open.png" Click="openSub_Click"></ribbon:RibbonButton>
                        </ribbon:RibbonGroup>

                        <ribbon:RibbonGroup x:Name="languageGroup" Header="Choose Language"/>

                        <ribbon:RibbonGroup Header="Operations">
                            <ribbon:RibbonButton Label="Known" LargeImageSource="Images/known.png" Click="known_Click"></ribbon:RibbonButton>
                            <ribbon:RibbonButton Label="Misspelled" LargeImageSource="Images/misspell.png" Click="Misspelling_Click"></ribbon:RibbonButton>
                        </ribbon:RibbonGroup>

                        <ribbon:RibbonGroup Header="Video">
                            <ribbon:RibbonButton Label="Choose video" LargeImageSource="Images/choosevideo.png" Click="chooseVideo_Click"></ribbon:RibbonButton>
                            <ribbon:RibbonButton Label="Play" LargeImageSource="Images/play.png" Click="play_Click"></ribbon:RibbonButton>
                        </ribbon:RibbonGroup>

                        <ribbon:RibbonGroup Header="Pronunciation">
                            <ribbon:RibbonButton Label="Pronounce" LargeImageSource="Images/pronounce.png" Click="pronounce_Click"/>
                            <ribbon:RibbonComboBox Label="Voice" SmallImageSource="Images/voice.png" Name="voiceComboBox">
                                <ribbon:RibbonGallery>
                                    <ribbon:RibbonGalleryCategory Name="voiceGalleryCategory"/>
                                </ribbon:RibbonGallery>
                            </ribbon:RibbonComboBox>
                        </ribbon:RibbonGroup>

                        <ribbon:RibbonGroup Header="Slides Show">
                            <ribbon:RibbonButton Label="Show" LargeImageSource="Images/slide.png" Click="slidesShow_Click"/>
                        </ribbon:RibbonGroup>

                    </ribbon:RibbonTab>
                    <ribbon:RibbonTab Header="Bambook">
                        <ribbon:RibbonGroup Header="Bambook Tools">
                            <ribbon:RibbonButton Label="Export" LargeImageSource="Images/Bambook.jpg" Click="ExportToBambook_Click"/>
                        </ribbon:RibbonGroup>
                    </ribbon:RibbonTab>
                </ribbon:Ribbon.Items>
            </ribbon:Ribbon>

            <Grid Grid.Row="1" Margin="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto" MinWidth="100"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <ListBox Margin="2" Grid.Column="0" Name="wordsListBox" SelectionChanged="wordListBox_SelectionChanged">
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="Margin" Value="2"/>
                        </Style>
                    </ListBox.ItemContainerStyle>
                </ListBox>
                <ContentControl Margin="2" Grid.Column="1" Name="mainArea">
                    <ListBox Name="explanationList" HorizontalContentAlignment="Stretch">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Border BorderBrush="LightGray" 
                                    BorderThickness="2" 
                                    Margin="5">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="auto"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <TextBlock Text="{Binding Language}" Grid.Row="0" Background="LightBlue" Foreground="DarkBlue"/>
                                        <ContentControl Content="{Binding ExplanationPresenter}" Grid.Row="1"/>
                                    </Grid>
                                </Border>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </ContentControl>
            </Grid>
        </Grid>
    </ex:BusyIndicator>
</ribbon:RibbonWindow>
